import {
  ADD_COUNT,
  SUB_COUNT,
  USERNAME
} from './constants';

// 利用action来修改状态
// const addAction = {type:ADD_COUNT, num: 1};
// const subAction = {type:SUB_COUNT, num: -1};
export const addAction = (num) => {
  return { type: ADD_COUNT, num: num };
};
export const subAction = (num) => {
  return { type: SUB_COUNT, num: num };
};
export const usernameAction = (username) => {
  return { type: USERNAME, username };
};

// 定义getUserInfo方法，在这个方法中发送网络请求并派发任务
export const getUserInfo = (dispatch, getState)=>{
  // 发送GET请求

}